package model

import (
	"context"
	"service/ctrl"
	"service/model/mod"

	gpb "gitee.com/cloudapex/protos/crm_message/pb"
	"google.golang.org/grpc"
)

var SysMsg sysMsg

func init() {
	ctrl.GCon.RegistClienter(mod.GCONN_NOTIFY, func(c *grpc.ClientConn) {
		SysMsg.cli = gpb.NewMessageNoticeClient(c)
	})
}

type sysMsg struct {
	cli gpb.MessageNoticeClient
}

func (this *sysMsg) GetList(ctx context.Context, in *gpb.MssNoticeListReq) (*gpb.MssNoticeListRes, error) {
	return this.cli.MssNoticeList(ctx, in)
}

func (this *sysMsg) Add(ctx context.Context, in *gpb.MssNoticeCreateReq) (*gpb.MssNoticeCreateRes, error) {
	return this.cli.MssNoticeCreate(ctx, in)
}
